package handlerListen;

import com.nf.factory.Assignment;
import handlerListen.util.ToSimpleName;
import information.Information;
import util.HandFactory;

public class HandlerFactoryImp implements HandFactory {
    @Override
    public Object createAction(Information information) {
        //得到键值
        String s = ToSimpleName.toString(information.getClazz());
        Object fun = Assignment.fun(s);
        if(fun == null){
            throw new RuntimeException("Create handler instance fail.");
        }
        return fun;
    }
}
